<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>安装通积分兑换商城_安装通</title>
<meta name="description" content="安装通积分商城有丰富的礼品，可以使用积分进行兑换或者抽奖。安装通积分可以通过注册、签到、发布商品、评论等平台操作获得。">
<meta name="keywords" content="安装通积分兑换商城,安装通 ">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="/res/css/common/aztHeadFootMal.css" rel="stylesheet">
<link href="/res/css/mall/mallIndex.css" rel="stylesheet">
<body class="interal">
	<div id="coverDiv"></div>
	<img class="loading" alt="" src="/res/images/common/loadding.gif"/>
	[#assign link="integral" /] [#include "/front/common/front_head.html"]
	<div class="content indexContent fix" style="margin-top: 80px;">
		<div class="firstindexBox" style="position: relative;">

		[@advertise_template code='JF_LUNBO' /]

			<div class="fghtPoint">
				<div class="iterm1"> 
				<h3 class="usIntegral">[#if user??][#if userAccount??]${userAccount.usIntegral!0}[/#if][/#if]</h3>
				[#if user??]
				<h4>今天已领取了[#if sinceIntegral??]${sinceIntegral!0}[#else]0[/#if]个积分</h4>
				[#else]
				<h4 style="top: 150px;">登录后可查看您的积分</h4>
				[/#if]
				[#if user??][#if signCount=0]<button id="signbutton"  type="button">签到</button>[#else]<button type="button" onclick="fobid()">今日已签到</button>[/#if][#else]<button style="position:relative;top: 160px;" id="logbutton"  type="button">登录签到赚积分</button>[/#if]
				</div>
				<div class="iterm2">
					<h4>
						以下方式获得积分<a style="position: relative;">查看积分规则
							<div class="tip">
								<img alt="" src="/res/images/arrow/ask_06.png"> <strong>
									100积分 <img src="/res/images/unit/unit_06.png" /> = 1元 <img
									src="/res/images/unit/unit_03.png" />
								</strong>
								<ul>
								[#if integralInstruct??]
								[#list integralInstruct as integralInstruct]
									<li style="margin-top: 15px;"><dfn>◆</dfn><big>${integralInstruct.title!}<span>（${integralInstruct.descr!}<em>[#if integralInstruct.operateType=1]+[#else]-[/#if]${integralInstruct.score!}</em>分）
										</span></big></li>
								[/#list]
								[/#if]
								</ul>
							</div>
						</a>
					</h4>
					<div class="w240">
						<ul>
							<li class="signbutton">签到</li>
							<li onclick="window.open('/enquiry/all/choose ')"
								style="background-image: url(/res/images/respective/mall/point/pointIcon2.png);">发布询价单</li>
							<li onclick="window.open('/product/chooseCate')"
								style="background-image: url(/res/images/respective/mall/point/pointIcon3.png);">发布产品</li>
							 
							<li onclick="window.open('/xmh')"
								style="background-image: url(/res/images/respective/mall/point/pointIcon1_07.jpg);">询价单报价</li>
							<li onclick="window.open('/member')"
								style="background-image: url(/res/images/respective/mall/point/pointIcon1_09.jpg);width:85px;">订单确认购买</li>
							<li onclick="window.open('/order/quote')"
								style="background-image: url(/res/images/respective/mall/point/pointIcon1_11.jpg);">订单支付</li>
						</ul>
					</div>
					<img class="pre" alt="" src="/res/images/arrow/arow_07.png"
						onclick="pre();" /> <img class="next" alt=""
						src="/res/images/arrow/arow_09.png" onclick="next();" /> 
				</div>
			</div>
		</div>
		<div class="w1200 pointBa">
			<h3>
				<img src="/res/images/respective/mall/point/xt_03.png" /> <span>抽奖区·</span>积分抽奖好礼送不停
				<img src="/res/images/respective/mall/point/xt_06.png" />
			</h3>
			<div class="luckdraw fix">
				<div id="lottery">
					<table border="0" cellpadding="0" cellspacing="0">
						<tbody>
						[#if allPrizeSet?? && allPrizeSet?size > 10]
							<tr>
							[#list allPrizeSet as allSets]
							  [#if allSets_index < 3]
								<td class="lottery-unit lottery-unit-${(allSets.seq!0)-1}"><img
									src="${allSets.imgUrl!}"
									alt="" title="" _type="" _id="${allSets.id!}" _index="${(allSets.seq!0)-1}" type="${allSets.type!}">
									<h6>${allSets.giftName!}</h6></td>
							  [/#if]
						     [/#list] 
						     <td class="lottery-unit lottery-unit-3"><img
									src="/res/images/respective/mall/point/prize/prizepng_06.png">
									<h6>谢谢参与</h6></td>
							</tr>
							<tr>
							<td class="lottery-unit lottery-unit-${(allPrizeSet[10].seq!0)-1}"><img
									src="${allPrizeSet[10].imgUrl!}"
									alt="" title="" _type="" _id="${allPrizeSet[10].id!}" _index="${(allPrizeSet[10].seq!0)-1}" type="${allPrizeSet[10].type!}">
									<h6>${allPrizeSet[10].giftName!}</h6></td>
							<td colspan="2" rowspan="2"><a href="javascript:void(0);"></a></td>
							<td class="lottery-unit lottery-unit-${(allPrizeSet[3].seq!0)-1}"><img
									src="${allPrizeSet[3].imgUrl!}"
									alt="" title="" _type="" _id="${allPrizeSet[3].id!}" _index="${(allPrizeSet[3].seq!0)-1}" type="${allPrizeSet[3].type!}">
									<h6>${allPrizeSet[3].giftName!}</h6></td>
							</tr>
							<tr>
							<td class="lottery-unit lottery-unit-${(allPrizeSet[9].seq!0)-1}"><img
									src="${allPrizeSet[9].imgUrl!}"
									alt="" title="" _type="" _id="${allPrizeSet[9].id!}" _index="${(allPrizeSet[9].seq!0)-1}" type="${allPrizeSet[9].type!}">
									<h6>${allPrizeSet[9].giftName!}</h6></td>
							<td class="lottery-unit lottery-unit-${(allPrizeSet[4].seq!0)-1}"><img
									src="${allPrizeSet[4].imgUrl!}"
									alt="" title="" _type="" _id="${allPrizeSet[4].id!}" _index="${(allPrizeSet[4].seq!0)-1}" type="${allPrizeSet[4].type!}">
									<h6>${allPrizeSet[4].giftName!}</h6></td>
							</tr>
							<tr>
							<td class="lottery-unit lottery-unit-${(allPrizeSet[8].seq!0)-1}"><img
									src="${allPrizeSet[8].imgUrl!}"
									alt="" title="" _type="" _id="${allPrizeSet[8].id!}" _index="${(allPrizeSet[8].seq!0)-1}" type="${allPrizeSet[8].type!}">
									<h6>${allPrizeSet[8].giftName!}</h6></td>
							<td class="lottery-unit lottery-unit-${(allPrizeSet[7].seq!0)-1}"><img
									src="${allPrizeSet[7].imgUrl!}"
									alt="" title="" _type="" _id="${allPrizeSet[7].id!}" _index="${(allPrizeSet[7].seq!0)-1}" type="${allPrizeSet[7].type!}">
									<h6>${allPrizeSet[7].giftName!}</h6></td>
							<td class="lottery-unit lottery-unit-${(allPrizeSet[6].seq!0)-1}"><img
									src="${allPrizeSet[6].imgUrl!}"
									alt="" title="" _type="" _id="${allPrizeSet[6].id!}" _index="${(allPrizeSet[6].seq!0)-1}" type="${allPrizeSet[6].type!}">
									<h6>${allPrizeSet[6].giftName!}</h6></td>
							<td class="lottery-unit lottery-unit-${(allPrizeSet[5].seq!0)-1}"><img
									src="${allPrizeSet[5].imgUrl!}"
									alt="" title="" _type="" _id="${allPrizeSet[5].id!}" _index="${(allPrizeSet[5].seq!0)-1}" type="${allPrizeSet[5].type!}">
									<h6>${allPrizeSet[5].giftName!}</h6></td>
							</tr>
							[/#if]
						</tbody>
					</table>
				</div>
				<div class="des">
					<div>
						<h2>
							<img alt="" src="/res/images/respective/mall/point/spart_03.png" />
							中奖名单 <img alt=""
								src="/res/images/respective/mall/point/spart_06.png" />
						</h2>
						<div class="scroll_gets">
							<table>
								<tbody>
									[#if allPrizeRecord??] [#list allPrizeRecord as allRecords]
									[#if allRecords.prizeSet??]
									<tr>
										<td>
											<p class="name name1"
												title="[#if allRecords.hiddenUserName??]${allRecords.hiddenUserName!}${allRecords.companyName!}[/#if]">恭喜[#if
												allRecords.hiddenUserName??]${allRecords.hiddenUserName!}${allRecords.companyName!}[/#if]</p>
										</td>
										<td>
											<p class="name name2">
												抽中了 <span>${allRecords.prizeSet.giftName!}</span>
											</p>
										</td>
									</tr>
									[/#if]
									[/#list] [/#if]
								</tbody>
							</table>
						</div>
						<div class="role">
							<h3>活动规则：</h3>
							<ul>
								<li>1、使用299积分进行一次抽奖；</li>
								<li>2、积分类奖品，将直接充值到你的个人帐户中；</li>
								<li>3、话费类奖品，平台会在3个工作日内充值到对应手机中；</li>
								<li>4、<span>实物类奖品，平台会在20个工作日内邮寄到您的手中，请在中奖时填写您的详细信息，以便奖品及时送达。</span></li>
							</ul>
						</div>
					</div>
				</div>
			</div>
			<h3>
				<img src="/res/images/respective/mall/point/xt_11.png"> <span>兑换区·</span>积分换好礼
				<img src="/res/images/respective/mall/point/xt_06.png">
			</h3>
			<ul class="pointChange">
				<li class="all">综合</li>
				<li class="score0">1-1000分</li>
				<li class="score1">1000-20000分</li>
				<li class="score2">20000-30000分</li>
				<li class="score3">30000分以上</li>
				<li class="flr icanscore"><a>我能兑换的商品</a></li>
			</ul>
			<div class="gift">
	
			</div>
		</div>
	</div>
	<div class="drawResult detailjPrize" id="point">
		<img class="godPic" src="/res/images/respective/mall/point/result/prizeResult_10.png"/>
		<h4>50积分</h4>
		<h5><strong>提示：</strong>您中奖的积分已入账，可以到[用户中心-我的积分]中查看详情。</h5>
		<img class="close" alt="" src="/res/images/respective/mall/point/close_03.png"/>
	</div>
	<form id="drawformTel"> 
	<div class="drawResult detailjPrize" id="card">
		<img class="pzPic" src="/res/images/respective/mall/point/result/prizeResult_28.png"/> 
		<div class="connPerson">
			<label>手机号码：</label>
			<input type="text" data-rule="required;mobile" id="mobile" name="mobile"   maxlength="15"/>
			<button type="button" class="confir" onclick="subTel();">确认提交</button>
		</div>
		<h5><strong>提示：</strong>小通将在<strong>3</strong>个工作日内充值到您填写的手机号，如有疑问，请咨询<strong>400-848-1365</strong></h5>
		<img class="close" alt="" src="/res/images/respective/mall/point/close_03.png"/>
	</div> 
	</form>
	<div class="drawResult" id="thank">
		<img class="thPic" src="/res/images/respective/mall/point/result/prizeResult_25.png"/>
		<h4>谢谢参与</h4>
		<img class="close" alt="" src="/res/images/respective/mall/point/close_03.png"/>
	</div> 
	<div class="drawResult detailjPrize" id="god" > 
	<form id="drawformEntity"> 
		<img class="godPic" src="/res/images/respective/mall/point/result/prizeResult_21.png"/>
		<input id="recordId" name="id" type="hidden" value="">
		<h4>iPhone 6s 16G</h4>
		<div style="margin-top: 15px;">
			<label>邮寄地址：</label>
			<input name="contactAdd" data-rule="required;" type="text" maxlength="150"/>
		</div> 
		<div>
			<label>收件人：</label>
			<input name="contactName" data-rule="required;" type="text"  maxlength="45"/>
		</div> 
		<div style="margin-bottom: 10px;">
			<label>手机号码：</label>
			<input name="contactTel" data-rule="required;mobile" type="text"  maxlength="15"/>
		</div> 
		<button type="button" class="confir" onclick="subEntity();">确认提交</button>
		<!-- <button type="button" onclick="undoPrize();" >放弃奖品</button> -->
		</form>
		<img class="close" alt="" src="/res/images/respective/mall/point/close_03.png"/>
	</div>
	[#include "/front/common/front_foot.html"]
</body>
<script src="/res/js/common/jquery.1.9.1.min.js"></script>
<script src="/res/js/common/jquery.ellipsis.js"></script>
<script type="text/javascript" src="/res/third/layer/layer.js"></script>
<script type="text/javascript" src="/res/third/laytpl/laytpl.js"></script>
<script type="text/javascript" src="/res/third/laypage/laypage.js"></script>
<script type="text/javascript" src="/res/js/common/app/zDialog.js"></script>
<script src="/res/js/common/app/jquery.pagination.js"></script>
<script src="/res/js/common/app/jquery.utils.js"></script>
<script src="/res/third/nice-validator/jquery.validator.js?local=zh-CN"></script>
<script type="text/javascript">  
function fobid(){
	layer.confirm('今日已签到，记得明天再来哦~', {
		  btn: ['我知道了'] //按钮
		});
}
//文字滚动
function myplugin(obj,num,time){
  var slli, slul, iHeight;
  var $obj = $(obj);
  var time = time;
  if($obj.find('table').length){
	  slli = $obj.find("tr"); 
	  slul = $obj.find("table");
	  iHeight = slli.outerHeight()*num;
  }else{
	  slli = $obj.find("li");
	  slul = $obj.find("ul");
	  iHeight = slli.outerHeight();
  }
 

  var timer = null;
  var cont = num;

  var gundong= function(){
    if(slli.length>cont){
      slul.animate({marginTop:-iHeight},700,function(){
    	  if($obj.find('table').length){
    		  slul.find('tr').slice(0,num).remove().appendTo(slul.children('tbody')); 
    	  }else{
    		  $obj.find("li").eq(0).remove().appendTo(slul);
    	  }
        slul.css("margin-top",0)
      })
    }
  };

  slul.hover(function(){
            clearInterval(timer);
          },function(){
            timer= setInterval(gundong,time);
          }
  ).trigger("mouseleave");
}
function ShowjQueryFlash(i) {
	$("#focus ul>li").eq(i).animate({
		opacity : 1
	}, 1000).siblings("li").animate({
		opacity : 0
	}, 1000); 
	$("#focus ul>li").eq(i).find("a").animate({
		opacity : 1 
	}, 1000);
	$("#focus ul>li").eq(i).siblings("li").each(function(){
		$(this).find("a").animate({
			opacity : 0 
		}, 1000);
	}); 
	$("#focus .btn span").eq(i).addClass("on").siblings().removeClass("on");
} 

   function callUrl(minPoint,maxPoint){
	$(".gift").load("/integral/ajaxIntegralShop",{'pageNo':1,'so_minPoint' : minPoint,'so_maxPoint' : maxPoint},function(data){});
   }

   $('#drawformEntity,#drawformTel').validator({
		theme: 'yellow_top',
		stopOnError:true,
		timely: 2,
		msgClass : "n-top"
	});
   
   //提交奖品
   function subEntity(){ 
	   $("#drawformEntity").isValid(function() {
		   var data=$("#drawformEntity").serialize();
		   $.ajax({
				   type: "POST",
				   dataType:"json",
				   data:data,
				   url: "/integral/saveIntegralAddress",
				   success: function(data){
					   if(data.success){
						   layer.msg("填写成功！小通将稍后为您发放奖品！", {time:2000});
						   location.reload();
					   }else{
						   layer.msg("提交失败" , {time:2000});
					   }
				   }
			});
	   });
   }
   
 //提交充值手机号
   function subTel(){ 
	   var mobile=$("#mobile").val();
	   var id = $("#recordId").val();
	   $("#drawformTel").isValid(function() { 
			   $.ajax({
				   type: "POST",
				   dataType:"json",
				   data : {id :id,contactTel:mobile},
				   url: "/integral/saveIntegralAddress",
				   success: function(data){
					   if(data.success){
						   alert("填写成功！小通将稍后为您充值！")
						   location.reload();
					   }else{
						   layer.msg("提交失败" , {time:2000});
					   }
				   }
			});
		});
	   
   }
   
   //放弃奖品
   function undoPrize(){
	   var ok = confirm("是否确认放弃奖品？"); 
		if (ok) {
			 var data=$("#drawformEntity").serialize();
			 $.ajax({
				   type: "POST",
				   dataType:"json",
				   data:data,
				   url: "/integral/dropPrizeRecord",
				   success: function(data){
					   if(data.success){ 
						   location.reload();
					   }else{
						   layer.msg("提交失败" , {time:2000});
					   }
				   }
			}); 
		} 
   }
   
	$(function() {
		$(".drawResult>img.close").click(function(){
			$(this).parent("div").hide();
			$("#coverDiv").hide();
		})
		var isload='${isload!}'
		if(isload==0){
			$(".pointChange .all").addClass("on");
			callUrl(-1,-1);
		}
		
		//tab页面切换查询
		$(".pointChange .all").click(function(){
			callUrl(-1,-1);
		});
		$(".pointChange .score0").click(function(){
			callUrl(1,1000);
		});
		$(".pointChange .score1").click(function(){
			callUrl(1000,20000);
		});
		$(".pointChange .score2").click(function(){
			callUrl(20000,30000);
		});
		$(".pointChange .score3").click(function(){
			callUrl(30000,-1);
		});
		//我能兑换的
		$(".pointChange .icanscore").click(function(){
			//验证登录
			$.ajax({
			   type: "POST",
			   dataType:"json",
			   url: "/integral/islog",
			   success: function(data){
				   if(data.success){
					   callUrl(-2,-2);
				   }
			   }
		   });
		});
		
		   //登陆
		   $("#logbutton").click(function(){
				$.ajax({
					   type: "POST",
					   dataType:"json",
					   url: "/integral/islog",
					   success: function(data){
						   if(data.success){
							   location.reload();
						   }
					   }
				});
		   });
		   
		   //签到
		  $("#signbutton").click(function(){
				$.ajax({
					   type: "POST",
					   dataType:"json",
					   url: "/integral/isSign",
					   success: function(data){
						   if(data.success){ 
							   layer.msg("签到成功" , {time:2000},function(){
								  location.reload(); 
							   });
						 }else{
							   layer.msg("今日已签到" , {time:2000});
						   }
					   }
				   });
		   });
		
		  $(".signbutton").click(function(){
				$.ajax({
					   type: "POST",
					   dataType:"json",
					   url: "/integral/isSign",
					   success: function(data){
						   if(data.success){ 
							   layer.msg("签到成功" , {time:2000},function(){
								  location.reload(); 
							   });
						 }else{
							   layer.msg("今日已签到" , {time:2000});
						   }
					   }
				   });
		   });
		
		$("ul.pointChange li").each(function(){
			$(this).click(function(){
				$(this).siblings("li").removeClass("on");
				$(this).addClass("on");
			})
		})
		
		myplugin(".scroll_gets" , 9 , 4000);
		laypage.dir = '/res/third/laypage/skin/aztpage.css'; 
		$(".preNext").css("opacity",0.2).hover(function() {
			clearInterval(MyTime);
			$(this).stop(true,false).animate({"opacity":"0.5"},300);
		},function() {
			$(this).stop(true,false).animate({"opacity":"0.2"},300);
		});
		//上一页、下一页按钮透明度处理
		$(".hotGod span.page").each(function(){
			$(this).hover(function() {
				$(this).stop(true,false).animate({"opacity":"0.5"},300);
			},function() {
				$(this).stop(true,false).animate({"opacity":"0.2"},300);
			});
		});
		
		$(".preNext").css("opacity",0.2).hover(function() {
			clearInterval(MyTime);
			$(this).stop(true,false).animate({"opacity":"0.5"},300);
		},function() {
			$(this).stop(true,false).animate({"opacity":"0.2"},300);
		});
		/*翻页**/
		$(".preNext .pre").click(function(){
			clearInterval(MyTime);
			if(index==0){ 
				index=maximg-1; 
			}else{
				index--;
			}
			$("#focus .btn.point span").removeClass("on");
			$("#focus .btn.point span:eq("+index+")").addClass("on");
			$("#focus ul li").css("opacity","0");
			$("#focus ul li:eq("+index+")").css("opacity","1");
			$("#focus ul li a").css("opacity","0");
			$("#focus ul li:eq("+index+")").find("a").css("opacity","1");
		});
		$(".preNext .next").click(function(){
			clearInterval(MyTime);
			if(index==maximg-1){ 
				index=0; 
			}else{
				index++;
			}
			$("#focus .btn.point span").removeClass("on");
			$("#focus .btn.point span:eq("+index+")").addClass("on");
			$("#focus ul li").css("opacity","0");
			$("#focus ul li:eq("+index+")").css("opacity","1");
			$("#focus ul li a").css("opacity","0");
			$("#focus ul li:eq("+index+")").find("a").css("opacity","1");
		});
		var index = 0;
		var maximg = $("#focus").find("li").size();
		//商城广告焦点图
		$("#focus .btn span").hover(function() {
			if (MyTime) {
				clearInterval(MyTime);
			}
			index = $("#focus .btn span").index(this);
			MyTime = setTimeout(function() {
				ShowjQueryFlash(index);
				$('#focus ul').stop();
			}, 400);

		}, function() {
			clearInterval(MyTime);
			MyTime = setInterval(function() {
				ShowjQueryFlash(index);
				index++;
				if (index == maximg) {
					index = 0;
				}
			}, 3000);
		});
		//滑入 停止动画，滑出开始动画.
		$('#focus ul li').hover(function() {
			if (MyTime) {
				clearInterval(MyTime);
			}
		}, function() {
			MyTime = setInterval(function() {
				ShowjQueryFlash(index);
				index++;
				if (index == maximg) {
					index = 0;
				}
			}, 3000);
		});
		//自动播放
		var MyTime = setInterval(function() {
			ShowjQueryFlash(index);
			index++;
			if (index == maximg) {
				index = 0;
			}
		}, 3000);
		
	});
	
	var i2=0;//积分步数
	var pointSz=Math.ceil($(".w240 ul").find("li").size()/3);//积分屏量
	 /*上一个**/
    function pre(){
        var mgl=$(".w240 li:eq(0)").css("margin-left");
        if(mgl=="0px"){
            i2=-(pointSz-1);
            $(".w240 li:eq(0)").css("margin-left",i2*240);
        }else{
            i2++;
            $(".w240 li:eq(0)").css("margin-left",i2*240);
        }
    }
    /*下一个**/
    function next(){
        var mgl=$(".w240 li:eq(0)").css("margin-left");
        if(mgl==-240*(pointSz-1)+"px"){
            i2=0;
            $(".w240 li:eq(0)").css("margin-left",i2*240);
        }else{
            i2--;
            $(".w240 li:eq(0)").css("margin-left",i2*240);
        }
    }
    
  //抽奖js方法结束
    var lottery={
    		index:-1,	//当前转动到哪个位置，起点位置
    		count:0,	//总共有多少个位置
    		timer:0,	//setTimeout的ID，用clearTimeout清除
    		speed:20,	//初始转动速度
    		times:0,	//转动次数
    		cycle:50,	//转动基本次数：即至少需要转动多少次再进入抽奖环节
    		prize:-1,	//中奖位置
    		prizeGetId : 0,//中奖记录id
    		init:function(id){
    			if ($("#"+id).find(".lottery-unit").length>0) {
    				$lottery = $("#"+id);
    				$units = $lottery.find(".lottery-unit");
    				this.obj = $lottery;
    				this.count = $units.length;
    				$lottery.find(".lottery-unit-"+this.index).addClass("active");
    			};
    		},
    		roll:function(){
    			var index = this.index;
    			var count = this.count;
    			var lottery = this.obj; 
    			$(lottery).find(".lottery-unit-"+index).removeClass("active"); 
    			index += 1;
    			if (index>count-1) {
    				index = 0;
    			};
    			$(lottery).find(".lottery-unit-"+index).addClass("active");
    			this.index=index;
    			return false;
    		},
    		stop:function(index){
    			this.prize=index;
    			return false;
    		}
    	};
    function roll(){
		lottery.times += 1;
		lottery.roll();
		if (lottery.times > lottery.cycle+10 && lottery.prize==lottery.index) {
			clearTimeout(lottery.timer);
			//当lottery.prize不为感谢参与时，弹出中奖信息窗口    
			if(lottery.prize != 3 ){
				var $prize = $("#lottery td img[_index='"+lottery.prize+"']"); 
				var type = $prize.attr("type");  
				if(type == 3){//积分 
					var jf=$prize.siblings("h6").text();
					$("#point h4").text(jf);
					$("#point").show(); 
				} 
				$('#recordId').val(lottery.prizeGetId);
				if(type == 1){//充值卡 
					var carSrc=$prize.attr("src"); 
					$("#card img.pzPic").attr("src",carSrc);
					$("#card").show();
				}else if(type == 2){//实物 
					var godName=$prize.siblings("h6").text();
					var carSrc=$prize.attr("src");
					$("#god img.godPic").attr("src",carSrc);
					$("#god h4").text(godName);
					$("#god").show();
				}
			}else{ 
				$("#thank").show();
			}
			$("#coverDiv").show(); 
			lottery.prize=-1;
			lottery.times=0;
			click=false;
			
		}else{
			if (lottery.times<lottery.cycle) {
				lottery.speed -= 10;
			}else{
				if (lottery.times > lottery.cycle+10 && ((lottery.prize==0 && lottery.index==7) || lottery.prize==lottery.index+1)) {
					lottery.speed += 110;
				}else{
					lottery.speed += 20;
				}
			}
			if (lottery.speed<40) {
				lottery.speed=40;
			};
			//console.log(lottery.times+'^^^^^^'+lottery.speed+'^^^^^^^'+lottery.prize);
			lottery.timer = setTimeout(roll,lottery.speed);
		}
		return false;
	}
    function loginDialog() {
        var diag = new Dialog();
        diag.Title = "请登录";
        diag.Width = 360;
        diag.Height = 200;
        diag.InnerHtml =
                '<form id="signin-form" onsubmit="return false;">' +
                '<div class="form-box" style="padding-top:30px;">' +
                '<ul>' +
                '<li style="margin: 15px 0 15px 0;">' +
                '<label style="width:80px;font-size:13px;margin-right: 5px;">手机/邮箱:</label>' +
                '<div class="form-file"><input type="text" class="allInput" name="username" id="username" style="height: 28px;line-height: 28px;"/></div>' +
                '</li>' +
                '<li style="margin: 15px 0 15px 0;">' +
                '<label style="width:80px;font-size:13px;margin-right: 5px;">登录密码:</label>' +
                '<div class="form-file"><input type="password" class="allInput" name="password" id="password" style="height: 28px;line-height: 28px;" /></div>' +
                '</li>' +
                '</ul>' +
                '</div>' +
                '</form>';
        diag.OKEvent = function () {
            var username = $('#username').val();
            var password = $('#password').val();
            if (username == '') {
                alert("请输入用户名");
                return;
            }
            if (password == '') {
                alert("请输入密码");
                return;
            }
            var form = $('#signin-form');

            var data = form.serializeObject();
            data.password = $.md5(data.password);

            App.api('/user/dosignin', data).then(function (url) {
                location.reload();
            });
        };//点击确定后调用的方法
        diag.show();
    }
    var click=false;
    window.onload=function(){
		lottery.init('lottery');
		$("#coverDiv").hide();
		$(".loading").hide();  
		$("#lottery a").click(function(){ 
			if (1==2) { 
				/* return false; */
			}else{ 
				click=true;  
				$.ajax({
					   type: "POST",
					   dataType:"json",
					   url: "/integral/draw",
					   success: function(data){  
						   /* data={drawIngral:{result:1,prizeId:9,recordId:1,prizeSet:{giftName:2}}}; */ 
							var result = data.drawIngral.result;  
							switch(result){  
								case 2 : alert("抱歉！您的积分不够！");break;
								case 0 : {//未中奖
									lottery.speed=100;
									lottery.prize=3;//设置中奖位置
									roll();
									$(".usIntegral").text(data.drawIngral.usIntegral);
									break;
								}
								case 1 : {
									var prizeId = data.drawIngral.prizeId;//中奖礼品的id
									var recordId = data.drawIngral.recordId;//中奖记录id 
									var p = $("#lottery td img[_id='"+prizeId+"']").attr("_index");
									if(p){
										lottery.speed=100;
										lottery.prize=p;//设置中奖位置
										lottery.prizeGetId=recordId;//中奖记录id
										var pz=data.drawIngral.prizeSet.giftName;  
										$("#recordId").val(recordId);
										roll();
									}else{
										alert("意外出错，抱歉！");
									}
									$(".usIntegral").text(data.drawIngral.usIntegral);
									break;
								}
							}
					   }
				});
				
			}
		});
		
		
		 
	};
</script>
</html>
